\doxysection{fast\+\_\+math\+\_\+functions.\+h}
\hypertarget{fast__math__functions_8h_source}{}\label{fast__math__functions_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Middlewares/ST/ARM/DSP/Include/dsp/fast\_math\_functions.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Middlewares/ST/ARM/DSP/Include/dsp/fast\_math\_functions.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/******************************************************************************}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ @file\ \ \ \ \ fast\_math\_functions.h}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ @brief\ \ \ \ Public\ header\ file\ for\ CMSIS\ DSP\ Library}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ @version\ \ V1.10.0}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ @date\ \ \ \ \ 08\ July\ 2021}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Target\ Processor:\ Cortex-\/M\ and\ Cortex-\/A\ cores}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ ******************************************************************************/}}
\DoxyCodeLine{00008\ \textcolor{comment}{/*}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2010-\/2020\ Arm\ Limited\ or\ its\ affiliates.\ All\ rights\ reserved.}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ SPDX-\/License-\/Identifier:\ Apache-\/2.0}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ Licensed\ under\ the\ Apache\ License,\ Version\ 2.0\ (the\ License);\ you\ may}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ not\ use\ this\ file\ except\ in\ compliance\ with\ the\ License.}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ You\ may\ obtain\ a\ copy\ of\ the\ License\ at}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *\ www.apache.org/licenses/LICENSE-\/2.0}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Unless\ required\ by\ applicable\ law\ or\ agreed\ to\ in\ writing,\ software}}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ distributed\ under\ the\ License\ is\ distributed\ on\ an\ AS\ IS\ BASIS,\ WITHOUT}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *\ WARRANTIES\ OR\ CONDITIONS\ OF\ ANY\ KIND,\ either\ express\ or\ implied.}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ See\ the\ License\ for\ the\ specific\ language\ governing\ permissions\ and}}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ limitations\ under\ the\ License.}}
\DoxyCodeLine{00024\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \ }
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#ifndef\ \_FAST\_MATH\_FUNCTIONS\_H\_}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#define\ \_FAST\_MATH\_FUNCTIONS\_H\_}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#include\ "{}arm\_math\_types.h"{}}}
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#include\ "{}arm\_math\_memory.h"{}}}
\DoxyCodeLine{00032\ }
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#include\ "{}dsp/none.h"{}}}
\DoxyCodeLine{00034\ \textcolor{preprocessor}{\#include\ "{}dsp/utils.h"{}}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#include\ "{}dsp/basic\_math\_functions.h"{}}}
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\#include\ <math.h>}}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \textcolor{preprocessor}{\#ifdef\ \ \ \_\_cplusplus}}
\DoxyCodeLine{00041\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}}
\DoxyCodeLine{00042\ \{}
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \textcolor{preprocessor}{\#define\ FAST\_MATH\_TABLE\_SIZE\ \ 512}}
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#define\ FAST\_MATH\_Q31\_SHIFT\ \ \ (32\ -\/\ 10)}}
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#define\ FAST\_MATH\_Q15\_SHIFT\ \ \ (16\ -\/\ 10)}}
\DoxyCodeLine{00052\ \ \ }
\DoxyCodeLine{00053\ \textcolor{preprocessor}{\#ifndef\ PI}}
\DoxyCodeLine{00054\ \textcolor{preprocessor}{\ \ \#define\ PI\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3.14159265358979f}}
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\#ifndef\ PI\_F64\ }}
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\ \ \#define\ PI\_F64\ 3.14159265358979323846}}
\DoxyCodeLine{00059\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00078\ \ \ float32\_t\ arm\_sin\_f32(}
\DoxyCodeLine{00079\ \ \ float32\_t\ x);}
\DoxyCodeLine{00080\ }
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00087\ \ \ q31\_t\ arm\_sin\_q31(}
\DoxyCodeLine{00088\ \ \ q31\_t\ x);}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00095\ \ \ q15\_t\ arm\_sin\_q15(}
\DoxyCodeLine{00096\ \ \ q15\_t\ x);}
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00104\ \ \ float32\_t\ arm\_cos\_f32(}
\DoxyCodeLine{00105\ \ \ float32\_t\ x);}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00113\ \ \ q31\_t\ arm\_cos\_q31(}
\DoxyCodeLine{00114\ \ \ q31\_t\ x);}
\DoxyCodeLine{00115\ }
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00122\ \ \ q15\_t\ arm\_cos\_q15(}
\DoxyCodeLine{00123\ \ \ q15\_t\ x);}
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00133\ \ \ \textcolor{keywordtype}{void}\ arm\_vlog\_f32(}
\DoxyCodeLine{00134\ \ \ \textcolor{keyword}{const}\ float32\_t\ *\ pSrc,}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ float32\_t\ *\ pDst,}
\DoxyCodeLine{00136\ \ \ \ \ \ \ \ \ uint32\_t\ blockSize);}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00139\ }
\DoxyCodeLine{00147\ \ \ \textcolor{keywordtype}{void}\ arm\_vlog\_f64(}
\DoxyCodeLine{00148\ \ \ \textcolor{keyword}{const}\ float64\_t\ *\ pSrc,}
\DoxyCodeLine{00149\ \ \ \ \ \ \ \ \ float64\_t\ *\ pDst,}
\DoxyCodeLine{00150\ \ \ \ \ \ \ \ \ uint32\_t\ blockSize);}
\DoxyCodeLine{00151\ }
\DoxyCodeLine{00152\ }
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00161\ \ \ \textcolor{keywordtype}{void}\ arm\_vlog\_q31(\textcolor{keyword}{const}\ q31\_t\ *\ pSrc,}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ q31\_t\ *\ pDst,}
\DoxyCodeLine{00163\ \ \ \ \ \ \ \ \ uint32\_t\ blockSize);}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00172\ \ \ \textcolor{keywordtype}{void}\ arm\_vlog\_q15(\textcolor{keyword}{const}\ q15\_t\ *\ pSrc,}
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ q15\_t\ *\ pDst,}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ uint32\_t\ blockSize);}
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00176\ }
\DoxyCodeLine{00177\ }
\DoxyCodeLine{00185\ \ \ \textcolor{keywordtype}{void}\ arm\_vexp\_f32(}
\DoxyCodeLine{00186\ \ \ \textcolor{keyword}{const}\ float32\_t\ *\ pSrc,}
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ float32\_t\ *\ pDst,}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ uint32\_t\ blockSize);}
\DoxyCodeLine{00189\ }
\DoxyCodeLine{00190\ }
\DoxyCodeLine{00191\ }
\DoxyCodeLine{00199\ \ \ \textcolor{keywordtype}{void}\ arm\_vexp\_f64(}
\DoxyCodeLine{00200\ \ \ \textcolor{keyword}{const}\ float64\_t\ *\ pSrc,}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ float64\_t\ *\ pDst,}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ uint32\_t\ blockSize);}
\DoxyCodeLine{00203\ }
\DoxyCodeLine{00204\ }
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00225\ }
\DoxyCodeLine{00226\ }
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00240\ \_\_STATIC\_FORCEINLINE\ arm\_status\ \mbox{\hyperlink{group___s_q_r_t_ga5f37f479666ee8ff9711b334286c60ed}{arm\_sqrt\_f32}}(}
\DoxyCodeLine{00241\ \ \ \textcolor{keyword}{const}\ float32\_t\ in,}
\DoxyCodeLine{00242\ \ \ float32\_t\ *\ pOut)}
\DoxyCodeLine{00243\ \ \ \{}
\DoxyCodeLine{00244\ \ \ \ \ \textcolor{keywordflow}{if}\ (in\ >=\ 0.0f)}
\DoxyCodeLine{00245\ \ \ \ \ \{}
\DoxyCodeLine{00246\ \textcolor{preprocessor}{\#if\ defined\ (\ \_\_CC\_ARM\ )}}
\DoxyCodeLine{00247\ \textcolor{preprocessor}{\ \ \#if\ defined\ \_\_TARGET\_FPU\_VFP}}
\DoxyCodeLine{00248\ \ \ \ \ \ \ *pOut\ =\ \_\_sqrtf(in);}
\DoxyCodeLine{00249\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{00250\ \ \ \ \ \ \ *pOut\ =\ sqrtf(in);}
\DoxyCodeLine{00251\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{00252\ }
\DoxyCodeLine{00253\ \textcolor{preprocessor}{\#elif\ defined\ (\ \_\_ICCARM\_\_\ )}}
\DoxyCodeLine{00254\ \textcolor{preprocessor}{\ \ \#if\ defined\ \_\_ARMVFP\_\_}}
\DoxyCodeLine{00255\ \ \ \ \ \ \ \_\_ASM(\textcolor{stringliteral}{"{}VSQRT.F32\ \%0,\%1"{}}\ :\ \textcolor{stringliteral}{"{}=t"{}}(*pOut)\ :\ \textcolor{stringliteral}{"{}t"{}}(in));}
\DoxyCodeLine{00256\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{00257\ \ \ \ \ \ \ *pOut\ =\ sqrtf(in);}
\DoxyCodeLine{00258\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{00259\ }
\DoxyCodeLine{00260\ \textcolor{preprocessor}{\#elif\ defined\ (\ \_\_ARMCC\_VERSION\ )\ \&\&\ (\ \_\_ARMCC\_VERSION\ >=\ 6010050\ )}}
\DoxyCodeLine{00261\ \ \ \ \ \ \ *pOut\ =\ \_sqrtf(in);}
\DoxyCodeLine{00262\ \textcolor{preprocessor}{\#elif\ defined(\_\_GNUC\_PYTHON\_\_)}}
\DoxyCodeLine{00263\ \ \ \ \ \ \ *pOut\ =\ sqrtf(in);}
\DoxyCodeLine{00264\ \textcolor{preprocessor}{\#elif\ defined\ (\ \_\_GNUC\_\_\ )}}
\DoxyCodeLine{00265\ \textcolor{preprocessor}{\ \ \#if\ defined\ (\_\_VFP\_FP\_\_)\ \&\&\ !defined(\_\_SOFTFP\_\_)}}
\DoxyCodeLine{00266\ \ \ \ \ \ \ \_\_ASM(\textcolor{stringliteral}{"{}VSQRT.F32\ \%0,\%1"{}}\ :\ \textcolor{stringliteral}{"{}=t"{}}(*pOut)\ :\ \textcolor{stringliteral}{"{}t"{}}(in));}
\DoxyCodeLine{00267\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{00268\ \ \ \ \ \ \ *pOut\ =\ sqrtf(in);}
\DoxyCodeLine{00269\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{00270\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00271\ \ \ \ \ \ \ *pOut\ =\ sqrtf(in);}
\DoxyCodeLine{00272\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00273\ }
\DoxyCodeLine{00274\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (ARM\_MATH\_SUCCESS);}
\DoxyCodeLine{00275\ \ \ \ \ \}}
\DoxyCodeLine{00276\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00277\ \ \ \ \ \{}
\DoxyCodeLine{00278\ \ \ \ \ \ \ *pOut\ =\ 0.0f;}
\DoxyCodeLine{00279\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (ARM\_MATH\_ARGUMENT\_ERROR);}
\DoxyCodeLine{00280\ \ \ \ \ \}}
\DoxyCodeLine{00281\ \ \ \}}
\DoxyCodeLine{00282\ }
\DoxyCodeLine{00283\ }
\DoxyCodeLine{00292\ arm\_status\ \mbox{\hyperlink{group___s_q_r_t_ga119e25831e141d734d7ef10636670058}{arm\_sqrt\_q31}}(}
\DoxyCodeLine{00293\ \ \ q31\_t\ in,}
\DoxyCodeLine{00294\ \ \ q31\_t\ *\ pOut);}
\DoxyCodeLine{00295\ }
\DoxyCodeLine{00296\ }
\DoxyCodeLine{00305\ arm\_status\ \mbox{\hyperlink{group___s_q_r_t_ga5abe5ca724f3e15849662b03752c1238}{arm\_sqrt\_q15}}(}
\DoxyCodeLine{00306\ \ \ q15\_t\ in,}
\DoxyCodeLine{00307\ \ \ q15\_t\ *\ pOut);}
\DoxyCodeLine{00308\ }
\DoxyCodeLine{00309\ }
\DoxyCodeLine{00310\ }
\DoxyCodeLine{00314\ }
\DoxyCodeLine{00326\ }
\DoxyCodeLine{00327\ arm\_status\ arm\_divide\_q15(q15\_t\ numerator,}
\DoxyCodeLine{00328\ \ \ q15\_t\ denominator,}
\DoxyCodeLine{00329\ \ \ q15\_t\ *quotient,}
\DoxyCodeLine{00330\ \ \ int16\_t\ *shift);}
\DoxyCodeLine{00331\ }
\DoxyCodeLine{00343\ }
\DoxyCodeLine{00344\ arm\_status\ arm\_divide\_q31(q31\_t\ numerator,}
\DoxyCodeLine{00345\ \ \ q31\_t\ denominator,}
\DoxyCodeLine{00346\ \ \ q31\_t\ *quotient,}
\DoxyCodeLine{00347\ \ \ int16\_t\ *shift);}
\DoxyCodeLine{00348\ }
\DoxyCodeLine{00349\ }
\DoxyCodeLine{00350\ }
\DoxyCodeLine{00358\ \ \ arm\_status\ arm\_atan2\_f32(float32\_t\ y,float32\_t\ x,float32\_t\ *result);}
\DoxyCodeLine{00359\ }
\DoxyCodeLine{00360\ }
\DoxyCodeLine{00368\ \ \ arm\_status\ arm\_atan2\_q31(q31\_t\ y,q31\_t\ x,q31\_t\ *result);}
\DoxyCodeLine{00369\ }
\DoxyCodeLine{00377\ \ \ arm\_status\ arm\_atan2\_q15(q15\_t\ y,q15\_t\ x,q15\_t\ *result);}
\DoxyCodeLine{00378\ }
\DoxyCodeLine{00379\ \textcolor{preprocessor}{\#ifdef\ \ \ \_\_cplusplus}}
\DoxyCodeLine{00380\ \}}
\DoxyCodeLine{00381\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00382\ }
\DoxyCodeLine{00383\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ ifndef\ \_FAST\_MATH\_FUNCTIONS\_H\_\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
